package spark.core.scala

import org.apache.spark.{SparkContext, SparkConf}

/**
 * Created by Administrator on 2018/2/8/008.
 */
object LocalFile {
  def main(args: Array[String]) {

    val conf = new SparkConf()
    .setAppName("LocalFile")

    val sc = new SparkContext(conf)
    val lines = sc.textFile("hdfs://bigdata00:8020/wordcount.txt")

    val count = lines.map(line => line.length).reduce(_+_)

    println("file total nums is " + count)


  }
}
